package engine.display.newAttack.action
{
	import com.greensock.TweenLite;
	import com.greensock.TweenMax;
	import com.greensock.easing.Elastic;
	
	import engine.display.newAttack.AttackLogic;
	import engine.display.newAttack.AttackPlayer;
	import engine.display.newAttack.AttackSceneView;
	
	import flash.display.DisplayObjectContainer;
	import flash.display.MovieClip;
	import flash.geom.Point;

	public class AttackAction
	{
//		protected static const SCENE_EFFECT_NULL:int	=	0; 
//		
//		protected static const SCENE_EFFECT_START:int	=	0;
//		
//		protected static const SCENE_EFFECT_NULL:int	=	0;
		
		/**
		 * 黑屏事件
		 * */
		protected static const BLACKSCENE_EFFECT_DELAY:int	=	300;
		
		public function AttackAction()
		{
		}
		
		/**
		 * 获取资源定位点坐标
		 * @param Player	角色对象
		 * @param Pos		点标示
		 * @return 
		 * 
		 */
		protected function getPlayerSkinPosPoint(
			player:AttackPlayer,pos:String):Point
		{
			var	npcSkin	:MovieClip	=	player.getSkin();
			
			var tPoint	:Point	=	new Point();
			
			if(player.team>0)
			{
				tPoint.x	=	npcSkin[pos].x;
			}
			else
			{
				tPoint.x	=	-npcSkin[pos].x
			}
			
			tPoint.y		=	npcSkin[pos].y;
			
			return tPoint;
		}
		
		/**
		 * 播放黑场景特效
		 * */
		protected function playBlackEffect():void
		{
			TweenMax.to( AttackLogic.getInstance().attackScene.sceneBG, BLACKSCENE_EFFECT_DELAY*.001, {colorTransform:{tint:0x000000, tintAmount:0.5}});
		}
		
		/**
		 * 移除黑场景特效
		 * */
		protected function removeBlackEffect():void
		{
			TweenMax.to(  AttackLogic.getInstance().attackScene.sceneBG, 0, {removeTint:true});
		}
		
		protected function shake( con : DisplayObjectContainer ):void 
		{
			TweenLite.from( con, 1, {y:"-30", ease:Elastic.easeOut, overwrite:true});
		}
	}
}